<?php

require_once 'Zend/View/Helper/Abstract.php';

class Core_View_Helper_Content_RenderContent extends Zend_View_Helper_Abstract
{
    public function renderContent($block, $rowset = null, $wordCount = 0)
    {
        if ($rowset == null) {
           $content = $this->view->page->getContent();
        } else {
            $content = $rowset;
        }

        $xhtml = '';

        if ($wordCount > 0) {
          $xhtml .= $this->view->truncateText($content->$block, $wordCount);
        } else {
          $xhtml .= $content->$block;
        }

        return stripslashes($xhtml);
    }
}